//
//  ViewController.m
//  滑动动画
//
//  Created by 8b410-2 on 16/12/10.
//  Copyright © 2016年 abb. All rights reserved.
//

#import "ViewController.h"
#import "SecondViewController.h"
@interface ViewController ()
@property (strong,nonatomic)UIButton *button;
@end

@implementation ViewController

- (void)viewDidLoad {
    [super viewDidLoad];
    [self.view setBackgroundColor:[UIColor greenColor]];
    _button = [UIButton buttonWithType:UIButtonTypeCustom];
    [_button setTitle:@"点我" forState:UIControlStateNormal];
    [_button setBackgroundColor:[UIColor redColor]];
    [_button setFrame:CGRectMake(100, 100, 100, 100)];
    [_button addTarget:self action:@selector(toSecondVC) forControlEvents:UIControlEventTouchUpInside];
    [self.view addSubview:_button];
    [self.navigationController popViewControllerAnimated:YES];
    
}

- (void)toSecondVC {
    SecondViewController *vc = [[SecondViewController alloc] init];
    [self.navigationController pushViewController:vc animated:YES];
}

@end
